<div class="panel panel-danger" ng-if="!success">
    <div class="panel-heading">
        <strong>{{(artifact.data || artifact.attachment.name) | fang}}</strong>
    </div>
    <div class="panel-body">
        {{content.errorMessage}}
    </div>
</div>


<div ng-switch="content.response_code" ng-if="success">
    <div ng-switch-when="1">
        <div class="panel panel-info">
            <div class="panel-heading"><strong>Summary</strong></div>
            <div class="panel-body">
                <dl class="dl-horizontal">
                    <dt>Score</dt>
                    <dd>{{content.positives}}/{{content.total}}</dd>
                </dl>
                <dl class="dl-horizontal">
                    <dt>Last analysis date</dt>
                    <dd>{{content.scan_date}}</dd>
                </dl>
                <dl class="dl-horizontal" ng-if="artifact.dataType === 'url'">
                    <dt>Virus Total</dt>
                    <dd>
                        <span>
                            <i class="fa fa-search"></i>
                            <a ng-href="https://www.virustotal.com/en/url/{{artifact.data | sha256}}/analysis/" target="_blank">
                                View Full Report</a>
                        </span>
                    </dd>
                </dl>
            </div>
        </div>

        <div class="panel panel-info">
            <div class="panel-heading"><strong>Scans</strong></div>
            <div class="panel-body">

                <table class="table table-hover">
                    <tr>
                        <th>Scanner</th>
                        <th>Detected</th>
                        <th>Result</th>
                        <th>Details</th>
                        <th>Update</th>
                        <th>Version</th>
                    </tr>
                    <tr ng-repeat="(scanner, result) in content.scans" ng-init="result.unrated = (result.result === 'unrated site')">
                        <td><strong>{{scanner}}</strong></td>
                        <td>
                            <i ng-class="{'text-danger fa fa-bug': result.detected, 'text-success fa fa-check-circle': !result.detected && !result.unrated, 'text-info fa fa-question-circle': result.unrated}"></i>
                        </td>
                        <td ng-class="{'text-info': result.unrated, 'text-danger': result.detected, 'text-success': !result.detected && !result.unrated}" class="wrap">{{result.result}}</td>
                        <td>
                            <a ng-if="result.detail" ng-href="{{result.detail}}" target="_blank"><i class="fa fa-search"></i> View details</a>
                        </td>
                        <td>{{result.update}}</td>
                        <td>{{result.version}}</td>
                    </tr>
                </table>
            </div>
        </div>


    </div>
    <div ng-switch-default>
        <div class="panel panel-danger">
            <div class="panel-heading">
                <strong>{{(artifact.data || artifact.attachment.name)| fang}}</strong>
            </div>
            <div class="panel-body">
                {{content.verbose_msg}}
            </div>
        </div>
    </div>
</div>
